#!/usr/bin/python3

num1 = input('请输入数字1:')
num2 = input('请输入数字2:')
try:
        num1 = float(num1)
        num2 = float(num2)
except ValueError:
    print('输入的不是数字')
    exit()

if num1 % 1 == 0:
    num1 = int(num1)

if num2 % 1 == 0:
    num2 = int(num2)

print('{0} + {1} = {2}'.format(num1, num2, num1 + num2))
print('{0} - {1} = {2}'.format(num1, num2, num1 - num2))
print('{0} * {1} = {2}'.format(num1, num2, num1 * num2))
print('{0} / {1} = {2}'.format(num1, num2, num1 / num2))
print('{0} % {1} = {2}'.format(num1, num2, num1 % num2))
